package de.paulzerr;
import static de.paulzerr.Constants.COLUMN_ID;
import static de.paulzerr.Constants.COLUMN_WORD;
import static de.paulzerr.Constants.TABLE_NAME;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class WordsData extends SQLiteOpenHelper{
	public static final String DATABASE_NAME = "words.db";
	public static final int DATABASE_VERSION = 1;
	

	public WordsData(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);		
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL("CREATE TABLE "+ TABLE_NAME + " ( "+ COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
				+ COLUMN_WORD + " TEXT)");
		
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE IF EXISTS "+ TABLE_NAME);
		onCreate(db);
	}

	

}
